package com.aistar.config;

import com.aistar.interceptor.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ClassName: WebMVCConfig
 * @date: 2021/10/18 21:09
 * @Description: TODO...本类用来演示:Spring配置类 - 拦截器
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Autowired
    private LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 注册登录拦截器
        registry.addInterceptor(loginInterceptor)
                .addPathPatterns("/user/**","/employer/**","/resume/**","/job/**");
//                .excludePathPatterns("/plugins/**","/imgs/**","/css/**","/js/**","/index","/login/");
    }
}
